<!DOCTYPE html>
<html>
<?php
echo $this->render('common/header.phtml');
?>
	<body>
	    <div class="bg">
		<?php
		echo $this->render('common/navi.phtml');
		?>
		<div class="model-box">
			<div class="pre-bt-box">
				<a href="###" class="pre-bt"></a>
			</div>
			<div class="model-bt-l">
				<div class="model-btl-inner">
					<ul>
						<?php
						$modelListTable = Zend_Registry::get('database')->modellist;
						$modelList = $this->modelList;
						foreach ($modelList as $model) {
							$pictures = unserialize($model[$modelListTable->pictures]);
							$pictureSize = current(unserialize($model[$modelListTable->pictureSize]));
							$width = round(285*($pictureSize['width'] / $pictureSize['height']));
						?>
						<li style="width: <?php echo $width + 31;?>px"><img style="width: <?php echo $width?>px" src="<?php echo $pictures[$model[$modelListTable->coverimage]];?>" height="285" width="<?php echo $width; ?>" />
						</li>
						<?php
						}
						?>
					</ul>
				</div>
			</div>
			<div class="model-column">
				<ul class="model-column-inner">
					<?php
					if ($this->language == 'zh') {
					    $descriptionKey = 'description1';
					} elseif ($this->language == 'pt') {
					    $descriptionKey = 'description3';
					} else {
					    $descriptionKey = 'description2';
					}
					foreach ($modelList as $model) {
						$pictures = unserialize($model[$modelListTable->pictures]);
						$pictureSize = current(unserialize($model[$modelListTable->pictureSize]));
						$width = round(285*($pictureSize['width'] / $pictureSize['height']));
						$description = strip_tags($model[$modelListTable->$descriptionKey]);
					?>
					<li style="width: <?php echo $width + 31;?>px">
					<a href="<?php echo APPLICATION_ACTION_PATH;?>/detail/index/id/<?php echo $model[$modelListTable->id]?>">
					<img alt="<?php echo $description; ?>" title="<?php echo $description; ?>" style="width: <?php echo $width?>px" src="<?php echo $pictures[$model[$modelListTable->coverimage]];?>" height="285" width="<?php echo $width; ?>" />
					</a>
					</li>
					<?php
					}
					?>
				</ul>
			</div>
			<div class="next-bt-box">
				<a href="###" class="next-bt"></a>
			</div>
			<div class="model-bt-r">
				<div class="model-btr-inner">
					<ul>
						<?php
						foreach ($modelList as $model) {
							$pictures = unserialize($model[$modelListTable->pictures]);
							$pictureSize = current(unserialize($model[$modelListTable->pictureSize]));
							$width = round(285*($pictureSize['width'] / $pictureSize['height']));
						?>
						<li style="width: <?php echo $width + 31;?>px"><img style="width: <?php echo $width?>px" src="<?php echo $pictures[$model[$modelListTable->coverimage]];?>" height="285" width="<?php echo $width; ?>" />
						</li>
						<?php
						}
						?>
					</ul>
				</div>
			</div>
		</div>
		<?php
		echo $this->render('common/footer.phtml');
		?>
		<?php
		echo $this->render('common/script.phtml');
		?>
		</div>
	</body>
</html>